-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flusing log uart during fault #6660
base: master
Are you sure you want to change the base?
Conversation
When system fault is occured, The system is in the irq locking state, The logs that have not yet been output remain in the uart buffer and are not output. So, For debugging, it is necessary to flush the log uart buffer before outputting the fault log. For flushing transmit buffe, we need to know xmit buffer is empty or not. Therefore, Add to so that uart_xmitchars function returns amount sent. the return value is 0, xmit buffer is empty. Signed-off-by: eunwoo.nam <[email protected]>
4ed0553
to
fef47cc
Compare
|
||
/* To avoid duplicated calling up_flush_console(). */ | ||
if (g_log_flush_running) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should have leave_critical_section here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Updated!
…ault log. since, The system fault is occured, uart log is stil in the uart buffer and not printed. So, we can't see last log. Therefore, Add flusing log uart buffer when fault is occured. Signed-off-by: eunwoo.nam <[email protected]>
fef47cc
to
9e0b6b9
Compare
do { | ||
while (!LOGUART_Ready()); | ||
nbyte = uart_xmitchars(&CONSOLE_DEV); | ||
} while (nbyte); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work? Currently it looks like we still rely on uart interrupts to send data. But interrupts are disabled. Wont it be better to use lldbg path instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IRQ is calling uart_xmitchars()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant uart_xmitchars path is through drivers (will call the drivers send function and it also has some signalling logic to wakeup other threads), but at this point, we are no longer using the driver's path to print logs. Instead we use lldbg, so I asked the above question, why not use up_putc instead of driver send.
No description provided.